package com.xiaozhichao.javaapi.designpattern.proxy;


import java.lang.reflect.Proxy;

/**
 * jdk动态代理只能代理接口实现类
 */
public class JdkProxyTest {

    public static void main(String[] args) {
        Base targe = new BaseImp();
        Class classz = targe.getClass();
        Base obj = (Base)Proxy.newProxyInstance(classz.getClassLoader(),classz.getInterfaces(),new InvocationHandleImp(targe));
        obj.method1("ss",13);
    }
}
